|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
JarModule.java | 50% | 70% | 100% | 67.7% |
|
1 |
/*
|
|
2 |
* Copyright 2001-2004 The Apache Software Foundation.
|
|
3 |
*
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
6 |
* You may obtain a copy of the License at
|
|
7 |
*
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9 |
*
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13 |
* See the License for the specific language governing permissions and
|
|
14 |
* limitations under the License.
|
|
15 |
*/
|
|
16 |
|
|
17 |
package org.apache.geronimo.ews.ws4j2ee.module;
|
|
18 |
|
|
19 |
import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationFault;
|
|
20 |
|
|
21 |
import java.io.File;
|
|
22 |
import java.net.MalformedURLException;
|
|
23 |
import java.net.URL;
|
|
24 |
import java.net.URLClassLoader;
|
|
25 |
import java.util.ArrayList;
|
|
26 |
|
|
27 |
/**
|
|
28 |
* @author Srinath Perera(hemapani@opensource.lk)
|
|
29 |
*/
|
|
30 |
public class JarModule extends AbstractModule { |
|
31 |
private ClassLoader cl;
|
|
32 |
private ArrayList list = new ArrayList(1); |
|
33 |
|
|
34 |
/**
|
|
35 |
* @param jarFile
|
|
36 |
* @throws GenerationFault
|
|
37 |
*/
|
|
38 | 7 |
public JarModule(String jarFile, ClassLoader parentCL)
|
39 |
throws GenerationFault {
|
|
40 | 7 |
super(jarFile, parentCL);
|
41 | 7 |
try {
|
42 | 7 |
this.parentCL = parentCL;
|
43 | 7 |
list.add(new File(jarFile));
|
44 | 7 |
cl = new URLClassLoader(new URL[]{(new File(jarFile)).toURL()}, parentCL); |
45 | 7 |
wscfFile = getInputStreamForJarEntry(jarFile, "META-INF/webservices.xml");
|
46 | 7 |
if (wscfFile == null) { |
47 | 0 |
wscfFile = |
48 |
getInputStreamForJarEntry(jarFile, "META-INF/webservice.xml");
|
|
49 |
} |
|
50 | 7 |
if (wscfFile == null) { |
51 | 0 |
wscfFile = getInputStreamForJarEntry(jarFile, "webservice.xml");
|
52 |
} |
|
53 | 7 |
webddfile = getInputStreamForJarEntry(jarFile, "META-INF/web.xml");
|
54 | 7 |
if (wscfFile == null) { |
55 | 0 |
webddfile = getInputStreamForJarEntry(jarFile, "web.xml");
|
56 |
} |
|
57 | 7 |
ejbJarfile = getInputStreamForJarEntry(jarFile, "META-INF/ejb-jar.xml");
|
58 | 7 |
if (wscfFile == null) |
59 | 0 |
throw new GenerationFault("wscf file must not be null"); |
60 |
} catch (MalformedURLException e) {
|
|
61 | 0 |
e.printStackTrace(); |
62 | 0 |
throw GenerationFault.createGenerationFault(e);
|
63 |
} |
|
64 |
} |
|
65 |
|
|
66 |
/* (non-Javadoc)
|
|
67 |
* @see org.apache.geronimo.ews.ws4j2ee.utils.packager.load.PackageModule#getClassLoaderWithPackageLoaded()
|
|
68 |
*/
|
|
69 | 7 |
public ClassLoader getClassLoaderWithPackageLoaded() {
|
70 | 7 |
return cl;
|
71 |
} |
|
72 |
|
|
73 | 6 |
public ArrayList getClassPathElements() {
|
74 | 6 |
return list;
|
75 |
} |
|
76 |
} |
|
77 |
|
|